package com.fbms.module.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fbms.common.result.Res;
import com.fbms.common.result.ResBuilder;
import com.fbms.module.system.bean.dto.SysMenuDTO;
import com.fbms.module.system.bean.entity.SysRole;
import com.fbms.module.system.service.ISysMenuService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 类描述：菜单控制类
 *
 * @ClassName SysMenuController
 * @Author HappyBoy
 * @Date 2023-04-03 10:33
 **/
@RestController
@RequestMapping("/menu")
@Slf4j
@RequiredArgsConstructor
public class SysMenuController {

    /**
     * 菜单服务类
     */
    private final ISysMenuService menuService;

    /**
     * 获取全部菜单列表
     * @return 菜单列表
     */
    @GetMapping("/list")
    public Res<List<SysMenuDTO>> getMenuList(){
        return ResBuilder.of(menuService.getMenuList());
    }

}
